package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DbOrderMapper;
import com.ruoyi.system.domain.DbOrder;
import com.ruoyi.system.service.IDbOrderService;

/**
 * 订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-08
 */
@Service
public class DbOrderServiceImpl implements IDbOrderService 
{
    @Autowired
    private DbOrderMapper dbOrderMapper;

    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    @Override
    public DbOrder selectDbOrderById(Long id)
    {
        return dbOrderMapper.selectDbOrderById(id);
    }

    /**
     * 查询订单列表
     * 
     * @param dbOrder 订单
     * @return 订单
     */
    @Override
    public List<DbOrder> selectDbOrderList(DbOrder dbOrder)
    {
        return dbOrderMapper.selectDbOrderList(dbOrder);
    }

    /**
     * 新增订单
     * 
     * @param dbOrder 订单
     * @return 结果
     */
    @Override
    public int insertDbOrder(DbOrder dbOrder)
    {
        dbOrder.setCreateTime(DateUtils.getNowDate());
        return dbOrderMapper.insertDbOrder(dbOrder);
    }

    /**
     * 修改订单
     * 
     * @param dbOrder 订单
     * @return 结果
     */
    @Override
    public int updateDbOrder(DbOrder dbOrder)
    {
        dbOrder.setUpdateTime(DateUtils.getNowDate());
        return dbOrderMapper.updateDbOrder(dbOrder);
    }

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteDbOrderByIds(Long[] ids)
    {
        return dbOrderMapper.deleteDbOrderByIds(ids);
    }

    /**
     * 删除订单信息
     * 
     * @param id 订单主键
     * @return 结果
     */
    @Override
    public int deleteDbOrderById(Long id)
    {
        return dbOrderMapper.deleteDbOrderById(id);
    }
}
